<cfscript>    
    view = createObject("component", session.rootDir & ".views.layout");
    if( Session.Auth EQ True and (Session.strAuthType EQ Session.MANAGERS or Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR) ){
        view.init("Step 3: Terminate Employee",
            "/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js, /" & session.rootDir & "/static/js/SCF/Step3-ExecuteTermination.js",
            "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css","Home",main, "Termination");
    }else{
        view.init("Denied","","","Home","Denied");
    }    
    view.html();
</cfscript>

<cffunction name="main" access="public" output="true" returntype="any">
    <cfparam default="-1" name="url.TermReqID" />
    <cfscript>
        import models.*;
        KronosQueries = CreateObject("component", session.rootDir & ".DatabaseQueries.Kronos");
        TermRequest = entityLoadByPK("TerminationRequests", URL.TermReqID);
        Rosetta = EntityLoad("RosettaStone", TermRequest.getRosettaID());
        Employee = KronosQueries.funcGetCurrentEmployees( TermRequest.getRosettaID() );
        FormAction = '/' & session.rootDir & '/controller/TerminationHandler.cfm';
    </cfscript>
    
    <cfoutput> 
    <h1 class="title">Step 3: Terminate Employee</h1>
        <div class="entry">    
            The termination of employee records has been initiated for 
            <strong>#Employee.FirstName# #Employee.LastName#</strong>. 
            Please wait while E-PAR terminates the following system records:<br /><br />
        </div>
        
        <cfform name="frmTermination">
            <input type="hidden" id="RosettaID" value="#TermRequest.getRosettaID()#" />
            <input type="hidden" id="TermReqID" value="#URL.TermReqID#" />
            <input type="hidden" id="images" value="/#session.rootDir#/images/" />
            <input type="hidden" id="FormAction" value="#FormAction#" />
            
            <table>
                <tr>
                    <td width='25'>&nbsp;</td>
                    <td>
                        <table>
                            <tr>
                                <td valign='top' nowrap="nowrap">Disable Network Account:</td>
                                <td valign='top'>
                                    <span id="AD" class="error"></span>&nbsp;<img id="AD" src="#session.rootDir#/images/blank.jpg" />
                                </td>
                            </tr>
                            <tr>
                                <td valign='top' nowrap="nowrap">Archive Home Folder:</td>
                                <td valign='top'>
                                    <span id="HomeFolder" class="error"></span>&nbsp;<img id="HomeFolder" src="#session.rootDir#/images/blank.jpg" />
                                </td>
                            </tr>
                            <tr>
                                <td valign='top'>HR Employee Record:</td>
                                <td valign='top'>  
                                    <span id="HR" class="error"></span>&nbsp;<img id="HR" src="#session.rootDir#/images/blank.jpg" />    
                                </td>
                            </tr>
                            <tr>
                                <td valign='top' nowrap="nowrap">Disable TimeKeeper:</td>
                                <td valign='top'>
                                    <span id="TimeKeeper" class="error"></span>&nbsp;<img id="TimeKeeper" src="#session.rootDir#/images/blank.jpg" />
                                </td>
                            </tr>
                            <tr>
                                <td valign='top' nowrap="nowrap">Export Mailbox:</td>
                                <td valign='top'>
                                    <span id="ExportMail" class="error"></span>&nbsp;<img id="ExportMail" src="#session.rootDir#/images/blank.jpg" />
                                </td>
                            </tr>
                            <tr>
                                <td valign='top' nowrap="nowrap">Archive User Account:</td>
                                <td valign='top'>
                                    <span id="UserAccount" class="error"></span>&nbsp;<img id="UserAccount" src="#session.rootDir#/images/blank.jpg" />
                                </td>
                            </tr>
                            <tr>
                                <td valign='top' nowrap="nowrap">Rosetta Stone Record:</td>
                                <td valign='top'>
                                    <span id="Rosetta" class="error"></span>&nbsp;<img id="Rosetta" src="#session.rootDir#/images/blank.jpg" />  
                                </td>
                            </tr>
                        </table>                                    
                    </td>
                </tr>
                <tr>
                    <td width='25'>&nbsp;</td>
                </tr>
                <tr>
                    <td width='25'>&nbsp;</td>
                    <td>
                        <span id="Notice" class="error">During this time, please refrain from refreshing the page.</span>                              
                    </td>
                </tr>
            </table>
        </cfform>    
    </cfoutput>
    
</cffunction>